import { apiGet, apiPost } from '../func/fetch'
import type { DeviceList, DicsList, TodayStatistics } from './type'
import { ContentType } from '@/api/global.ts'

const _api = import.meta.env.VITE_FACEID_URL
// <-- 首页 -->
// 首页值机和登机口信息
export const deviceApi = (params: { areaId: 'zj' | 'dj' }): Promise<DeviceList[]> => {
  return apiPost('/bp-acs/device/getDeviceFlightByAreaId', params, ContentType.APPLICATION_JSON)
}
// 今日统计
export const todayStatisticsApi = (): Promise<TodayStatistics> => {
  return apiGet(`${_api}/flightSchedule/todayStatistics`)
}
// 字典
export const dicsApi = (type: string): Promise<DicsList[]> => {
  return apiGet(`${_api}/dics/${type}`)
}
